package com.zw.stock_sell_storage.controller;

import com.zw.stock_sell_storage.dto.PurchasingCarDto;
import com.zw.stock_sell_storage.dto.PurchasingDetailDto;
import com.zw.stock_sell_storage.service.IPurchasingDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/purchasingDetail")
public class PurchasingDetailController {
    @Autowired
    IPurchasingDetailService iPurchasingDetailService;

    @RequestMapping("/queryPurchasingDetailByPurchasingId")
    public List<PurchasingDetailDto> queryPurchasingDetailByPurchasingId(int purchasingId){
        return iPurchasingDetailService.queryPurchasingDetailByPurchasingId(purchasingId);
    }

    @RequestMapping("/addPurchasingDetails")
    public boolean addPurchasingDetails(@RequestBody List<PurchasingDetailDto> purchasingDetailList){
        return iPurchasingDetailService.addPurchasingDetails(purchasingDetailList);
    }
}
